<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



<html>
	<script language="JavaScript" type="text/JavaScript">
		window.onload = function()
		{
			document.getElementById("div1").style.display = 'none';
			document.getElementById("div2").style.display = 'none';
			document.getElementById("div3").style.display = 'none';
			document.getElementById("div4").style.display = 'none';
			document.getElementById("col1").style.display = 'none';
			if('${userSession}' ==  "" || '${userSession}' ==  null)
				self.location = "login.jsp";
			if('${error}' != "" && '${error}' != null)
			{
				document.getElementById("col1").style.display = 'block';
				document.getElementById("div3").style.display = 'block';
			}
			else
				document.getElementById("div1").style.display = 'block';
				
		}
		
		function pageDisplay(div)
		{
			document.getElementById("div1").style.display = 'none';
			if(div == "NB")
			{
				document.getElementById("div2").style.display = 'block';
			}
			else if(div == 'EB')
			{
				document.getElementById("div2").style.display = 'none';
				document.getElementById("div4").style.display = 'block';
			}
			else if(div == 'CC')
			{
				document.getElementById("col1").style.display = 'none';
				document.getElementById("div2").style.display = 'none';
				document.getElementById("div3").style.display = 'block';
			}
		}
		
	</script>
	<body>
		<form method="post" action="staffHome">
			<h1>Staff Home</h1>
			<div id="div1">
				<p>Welcome, <b>${currentuser}</b></p>
				<a href="javascript:pageDisplay('NB')">Book a New Ticket</a> <br><br><br>
				 <a href="existingBookings.jsp">Existing Booking</a>
			</div>

			<div id="div2">
				<a href="newCustomer.jsp">New Customer</a> <br><br><br>
				<a href="javascript:pageDisplay('CC')">Existing Customer</a>
			</div>

			<div id="div3">
				<table cellspacing="10">
					<tr><td>Enter Customer Id: </td>
					<td><input type="text" name="cid" size="9" maxlength="9" value="${cid}"/></td><td style="color:red;">${error}</td></tr>
				</table><br>
					<p id="col1">Click <a style="color:blue;text-decoration:none;" href="newCustomer.jsp">here</a> to create a New Customer.</p>
			<br>
			<input id="submit" type="submit" name="submit" value="submit"/>					
			</div>

			<div id="div4">
				Existing Booking
			</div>

		</form>
	</body>
</html>